<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>winow对象</title>
		<script>
			console.log(window);
			//alert(window.btoa("33sdfsdf"));
			function getLoc(){
				alert("host:"+window.location.host);
				alert("hostname:"+window.location.hostname);
				alert("href:"+window.location.href);
			}
			function goBaidu(){
				//window.location="https://www.baidu.com";
				window.location.href="https://www.baidu.com";
			}
			function goJd(){
				window.location.replace("https://www.jd.com");//无法后退
			}
		</script>
	</head>
	<body>
		<button type="button" onclick="getLoc()">获得location的属性</button>
		<button type="button" onclick="goBaidu()">去baidu</button>
		<button type="button" onclick="goJd()">去jd</button>
		<button type="button" onclick="javascript:window.location.reload()">刷新</button>
	</body>
</html>